package com.sage.dao.impl;


import org.hibernate.Hibernate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.sage.commons.dao.BaseDao;
import com.sage.dao.ISPDao;
import com.sage.dao.model.ISP;


@SuppressWarnings("unchecked")
@Repository
public class ISPDaoImpl extends BaseDao<ISP, Long> implements ISPDao{

	@Transactional(readOnly=true)
	@Override
	public ISP findByKey(String pnKey) {
		ISP isp = getByHQL("FROM ISP as isp WHERE isp.pn_key=?", pnKey);
		Hibernate.initialize(isp.getServerISPs());
		return isp;
	}
	
}
